﻿using System;

namespace Heimdallr
{
    /// <summary>
    /// Define a <see cref="ServiceElement"/> as a trigger.
    /// </summary>
    public interface ITriggerElement
    {
        /// <summary>
        /// Occurs when a notification needs to published by <see cref="INotifyElement"/>.
        /// </summary>
        event FireNotificationEventHandler Notify;

        /// <summary>
        /// Gets or sets the maximum data length of notifications.
        /// A negative value means no upper bound for the data length of incoming notification.
        /// </summary>
        /// <exception cref="NotSupportedException">The element does not support this property.</exception>
        /// <remarks>
        /// If the value of this property is greater than -1 and <see cref="Notification.ContentLength">ContentLength</see> is above it,
        /// the element will ignore it and will not raise the <see cref="Notify"/> event.
        /// </remarks>
        int MaxReceivedSize { get; set; }
    }
}